package States;

import java.util.ArrayList;
import Templates.State;
import Operators.WaterCupOperators.InitialState;


public class WaterCupState {
	private int capacity1;
	private int capacity2;
	
	public static State<WaterCupState> initalState()
	{
		return new State<WaterCupState>(new WaterCupState(),new InitialState());
	}
	
	public static ArrayList<State<WaterCupState>> finalStates()
	{
		ArrayList<State<WaterCupState>> fStates=new ArrayList<State<WaterCupState>>();
		fStates.add(new State<WaterCupState>(new WaterCupState(0,2),null));
		fStates.add(new State<WaterCupState>(new WaterCupState(1,2),null));
		fStates.add(new State<WaterCupState>(new WaterCupState(2,2),null));
		fStates.add(new State<WaterCupState>(new WaterCupState(3,2),null));
		return fStates;
	}

	public WaterCupState()
	{
		capacity1=0;
		capacity2=0;
	}
	public WaterCupState(int c1,int c2)
	{
		capacity1=c1;
		capacity2=c2;
	}
	public int getCapacity1()
	{
		return capacity1;
	}
	public int getCapacity2()
	{
		return capacity2;
	}
	public void setCapacity1(int c1)
	{
		capacity1=c1;
	}
	public void setCapacity2(int c2)
	{
		capacity2=c2;
	}
	public String toString()
	{
		return "Cup 1 contains: " +capacity1+"  Cup 2 contians: " +capacity2 + "\n"; 
	}
	public boolean equals(WaterCupState s)
	{
		if ((this.capacity1==s.capacity1) && (this.capacity2==s.capacity2))
		return true;
		return false;
		
	}

}
